package com.cloud.job;

import com.alibaba.fastjson.JSON;
import com.cloud.entity.ExceptionLogEntity;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;

import java.util.List;

@Slf4j
@Component
public class PullMesDataJob {

    @XxlJob("PullMesDataJob")
    public ReturnT<String> pullMesDataJob(String param) {
        log.info("拉取mes数据开始");
        JobParam jobParam = StringUtils.isBlank(param) ? null : JSON.parseObject(param, JobParam.class);


        log.info("拉取mes数据结束");
        return ReturnT.SUCCESS;
    }

    @Getter
    @Setter
    public static class JobParam {
        /**
         * 表名
         */
        private List<String> tableNames;

        /**
         * 开始时间
         */
        private String beginDate;

        /**
         * 结束时间
         */
        private String endDate;
    }
}
